# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=camscan
pkgver=1.0057215
pkgrel=4
groups=('blackarch' 'blackarch-scanner' 'blackarch-networking'
        'blackarch-defensive')
pkgdesc='A tool which will analyze the CAM table of Cisco switches to look for anamolies.'
arch=('any')
url='https://github.com/securestate/camscan'
license=('BSD')
depends=('python2' 'python2-paramiko')
makedepends=('git' 'python2-setuptools')
source=("git+https://github.com/securestate/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|/usr/bin/python|/usr/bin/python2|' "$pkgname.py"
}

package() {
  cd $pkgname

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

